home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ETO Development Tools 4
/
ETO Development Tools 4.iso
/
Tools - Objects
/
E.T.O. #4 Installer
/
Install
< prev
next >
Wrap
Text File
|
1991-05-23
|
18KB
|
711 lines
# C D I N S T A L L A T I O N S C R I P T
#
# Copyright Apple Computer, Inc. 1987, 1988, 1989, 1990, 1991
# All rights reserved.
#
# -------WARNING------
# This program was written on computers composed of 100% matter. Any contact
# with antimatter in any form will result in a Catastrophic Explosion™.
#
# This script is used to install MPW, MacApp, C++, SADE, MacsBug, Omega SANE,
# ResEdit and MPW 411 from the “E.T.O. #4” distribution compact disk
# onto a destination hard disk. This script can also update from previous
# versions of these products to the latest releases and revert from
# later versions to a previous release.
#
#
# This script accepts the following options (set by the Commando interface):
#
# -to sets the "to" directory
#
# -install flag to install a new complete version of MPW
# -update flag to update an existing version of MPW (default behaviour)
# -revert flag to revert to a previous version of MPW
#
# -progress flag to show progress
#
# -SADE1.0 flag to install SADE environment (version 1.0)
# -SADE1.1 flag to install SADE environment (version 1.1)
# -SADE1.2 flag to install SADE environment (version 1.2)
# -SADE1.3 flag to install SADE environment (version 1.3)
#
# -MB6.1 flag to install Macsbug (version 6.1 - in System Folder)
# -MB6.2 flag to install Macsbug (version 6.2 - in System Folder)
#
# -ResEdit1.2 flag to install ResEdit (version 1.2)
# -ResEdit2.1 flag to install ResEdit (version 2.1)
# -ReseditEXP flag to install ResEdit (version 2.1.1b1)
#
# -MPW3.0 flag to install MPW (version 3.0)
# -MPW3.1 flag to install MPW (version 3.1)
# -MPW3.2 flag to install MPW (version 3.2)
# -MPWQR flag to install MPW (version 3.2 QR4)
# -MPWEXP flag to install MPW (version 3.3 EXP AKA PQR4)
#
# -MacApp2 flag to install MacApp (version 2.0.1)
# -MacApp3 flag to install MacApp (version 3.0a2)
#
# -C++ flag to install C++ (version 3.1)
# -C++EXP flag to install C++ (version 3.2d4 AKA PQR4)
#
# -411Tools flag to install 411 in MPW folder (Tools only)
# -411All flag to install 411 in MPW folder (Complete environment)
#
# -SANE flag to install Omega SANE Init (version 1.0b4)
#
# -BB flag to install Big Brother
#
# -SB flag to install SourceBug
#
##################
### DEBUG CODE ###
##################
Set DebugFlag 0 # Set to 1 for debugging, set to 0 for normal operation
##################
Set quit 0 # Clear our user-defined quit flag. If it
Export quit # is ever Set non-zero, the user hit cancel
# somewhere and the script should quit.
Set Exit 0
Export Exit
### Set some defaults
Set CDVolume "E.T.O. #4:" ### the volume name of the distribution CD
Export CDVolume
Set Tools "Tools - Objects:" ### where the tools are located!
Export Tools
### Check to see if we can find the CD…
If Not "`Exists -d "{CDVolume}"`"
Alert "Volume {CDVolume} is not online!"
Exit 1
End
# {DestVolume} - the volume name of the destination hard drive
### Get the current volume name
Set DestVolume `which "{0}"` # get pathname of this script
Set DestVolume "`files -q -f "{DestVolume}"`" # convert to full pathname
If "{DestVolume}"=~/(≈:)®1≈/ # strip the filename
Set DestVolume "{®1}"
End
Loop
If "{DestVolume}"=~/(≈:)®1≈:/ # strip all sub-directories
Set DestVolume "{®1}"
Else
Break
End
End
export DestVolume
### Get the System Version (used for the SADE Installation)
Set SysVersion "`versionlist -h -u "{SystemFolder}" -creator MACS System`"
If "{SysVersion}" =~ /≈ 6.0.1≈/
Set SysVersion 61
Else If "{SysVersion}" =~ /≈ 6.0.2≈/
Set SysVersion 62
Else If "{SysVersion}" =~ /≈ 6.0.3≈/
Set SysVersion 63
Else If "{SysVersion}" =~ /≈ 6.0.4≈/
Set SysVersion 64
Else If "{SysVersion}" =~ /≈ 6.0.5≈/
Set SysVersion 65
Else If "{SysVersion}" =~ /≈ 6.0≈/
Set SysVersion 60
Else If "{SysVersion}" =~ /≈ 7.0b1≈/
Set SysVersion 71
Else If "{SysVersion}" =~ /≈ 7.0b2≈/
Set SysVersion 72
Else If "{SysVersion}" =~ /≈ 7.0b3≈/
Set SysVersion 73
Else If "{SysVersion}" =~ /≈ 7.0b4≈/
Set SysVersion 74
Else If "{SysVersion}" =~ /≈ 7.0b5≈/
Set SysVersion 75
Else If "{SysVersion}" =~ /≈ 7.0≈/
Set SysVersion 70
Else
Set SysVersion 50
End
export SysVersion
### Get the machine type and FPU type (used for the Omega SANE Installation)
Set MachType "`Gestalt "mach"`"
export MachType
Set FPUType "`Gestalt "fpu "`"
export FPUType
### Export some variables used by the Installer
set ToDir "{DestVolume}MPW Folder" # Destination ("to") directory
export ToDir
set FromDirs "" # Source ("from") directory list
export FromDirs
set ToSade "{DestVolume}SADE Folder" # SADE destination directory
export ToSade
set FromMacApp "" # MacApp source directory
export FromMacApp
set ToMacApp "{DestVolume}MacApp Folder" # MacApp destination directory
export ToMacApp
set InstallFlag 1 # Controls Update/Install/Revert (Update is the default)
set UpdateFlag "Update"
set RevertFlag "" # Controls revert function
set ProgressOption "" # Controls progress display
set MacAppFlag 0 # set for MacApp Installation (to install 411 files)
export MacAppFlag
set SADEOption 0 # Controls SADE Installation
export SADEOption
set MacsbugOption 0 # Controls Macsbug Installation
export MacsbugOption
set 411Option 0 # Controls 411 Installation
export 411Option
set ResEditOption 0 # Controls ResEdit Installation
export ResEditOption
set SANEOption 0 # Controls Omega SANE Installation
export SANEOption
set BBOption 0 # Controls Big Brother Installation
export BBOption
set DisciplineOption 0 # Controls Discipline Installation
export DisciplineOption
set ProffOption 0 # Controls Proff Tools Installation
export ProffOption
### Source Directories
set MPWSource "{CDVolume}{Tools}Macintosh Programmer’s Workshop:"
export MPWSource
set MacAppSource "{CDVolume}{Tools}MacApp:"
export MacAppSource
set CPlusSource "{CDVolume}{Tools}MPW C∂+∂+:"
export CPlusSource
### Let's get started...
If "{#}" == "0" ### Command Line is Empty
Exit 1
End
### See if the source volume exists...
If Not "`Exists -d "{CDVolume}"`"
Alert "Volume {CDVolume} is not online!"
Exit 1
End
### Collect the script parameters.
Loop
Break if {#} == 0
If "{1}" =~ /-to/
Set toDir "'{2}'"
shift 2
continue
Else If "{1}" =~ /-update/
set InstallFlag 1
set UpdateFlag "Update"
set RevertFlag ""
shift 1
continue
Else If "{1}" =~ /-install/
set InstallFlag 2
set UpdateFlag "Install"
set RevertFlag ""
shift 1
continue
Else If "{1}" =~ /-revert/
set InstallFlag 3
set UpdateFlag "Revert"
set RevertFlag "-revert"
shift 1
continue
Else If "{1}" =~ /-MPW3.0/
Set FromDirs "{FromDirs}'{MPWSource}MPW 3.0:MPW:' "
If Not "`Exists -d "{ToDir}"`"
NewFolder "{ToDir}"
End
shift 1
continue
Else If "{1}" =~ /-MPW3.1/
Set FromDirs "{FromDirs}'{MPWSource}MPW 3.1:MPW:' "
If Not "`Exists -d "{ToDir}"`"
NewFolder "{ToDir}"
End
shift 1
continue
Else If "{1}" =~ /-MPW3.2/
Set FromDirs "{FromDirs}'{MPWSource}MPW 3.2:MPW:' "
If Not "`Exists -d "{ToDir}"`"
NewFolder "{ToDir}"
End
shift 1
continue
Else If "{1}" =~ /-MPWQR/
Set FromDirs "{FromDirs}'{MPWSource}MPW 3.2:MPW:' " ### first install MPW 3.2
Set FromDirs "{FromDirs}'{MPWSource}MPW QR4:MPW:' " ### then install the QR4 version
If Not "`Exists -d "{ToDir}"`"
NewFolder "{ToDir}"
End
shift 1
continue
Else If "{1}" =~ /-MPWEXP/
Set FromDirs "{FromDirs}'{MPWSource}MPW 3.2:MPW:' " ### first install MPW 3.2
Set FromDirs "{FromDirs}'{MPWSource}MPW QR4:MPW:' " ### then install the QR4 version
Set FromDirs "{FromDirs}'{MPWSource}MPW PQR4:MPW PQR4:' " ### lastly install the newer stuff...
If Not "`Exists -d "{ToDir}"`"
NewFolder "{ToDir}"
End
shift 1
continue
Else If "{1}" =~ /-MacApp2/
set FromMacApp "MacApp 2.0.1:MacApp CD Release:MacApp 2.0.1 (Hard Disk Ready):"
If "`Exists -d "{MacAppSource}{FromMacApp}"`"
Set MacAppFlag 1
else
set FromMacApp ""
End
shift 1
continue
Else If "{1}" =~ /-MacApp3/
set FromMacApp "MacApp 3.0a2:"
If "`Exists -d "{MacAppSource}{FromMacApp}"`"
Set MacAppFlag 2
else
set FromMacApp ""
End
shift 1
continue
Else If "{1}" =~ /-CPlus/
If "`Exists -d "{CPlusSource}MPW C++ 3.1:"`"
Set FromDirs "{FromDirs}'{CPlusSource}MPW C∂+∂+ 3.1:' "
If Not "`Exists -d "{ToDir}"`"
NewFolder "{ToDir}"
End
End
shift 1
continue
Else If "{1}" =~ /-CPlusEXP/
If "`Exists -d "{CPlusSource}MPW C++ 3.1:"`"
Set FromDirs "{FromDirs}'{CPlusSource}MPW C∂+∂+ 3.1:' " ### first install the regular version
If "`Exists -d "{CPlusSource}MPW C++ PQR4:"`"
Set FromDirs "{FromDirs}'{CPlusSource}MPW C∂+∂+ PQR4:' " ### then install the newer stuff...
End
If Not "`Exists -d "{ToDir}"`"
NewFolder "{ToDir}"
End
End
shift 1
continue
Else If "{1}" =~ /-SADE1.0/
set SADEOption 1
shift 1
continue
Else If "{1}" =~ /-SADE1.1/
set SADEOption 2
shift 1
continue
Else If "{1}" =~ /-SADE1.2/
set SADEOption 3
shift 1
continue
Else If "{1}" =~ /-SADE1.3/
If {SysVersion} > 70 && {SysVersion} <= 74
Confirm "SADE 1.3 will only work with System Software version 7.0b4 or higher. Do you still wish to install SADE 1.3?"
Set SaveStatus {Status}
If {SaveStatus} == 0
set SADEOption 4
End
Else
set SADEOption 4
End
shift 1
continue
Else If "{1}" =~ /-MB6.1/
set MacsbugOption 1
shift 1
continue
Else If "{1}" =~ /-MB6.2/
set MacsbugOption 2
shift 1
continue
Else If "{1}" =~ /-411Tools/
set 411Option 1
shift 1
continue
Else If "{1}" =~ /-411All/
set 411Option 2
shift 1
continue
Else If "{1}" =~ /-ResEdit1.2/
set ResEditOption 1
shift 1
continue
Else If "{1}" =~ /-ResEdit2.1/
set ResEditOption 2
shift 1
continue
Else If "{1}" =~ /-ResEditEXP/
set ResEditOption 3
shift 1
continue
Else If "{1}" =~ /-SANE/
set SANEOption 1
shift 1
continue
Else If "{1}" =~ /-BB/ ### Big Brother
set BBOption 1
shift 1
continue
Else If "{1}" =~ /-SB/ ### SourceBug
set SBOption 1
shift 1
continue
Else If "{1}" =~ /-StrictD/ ### Strict Discipline 2.0
set DisciplineOption 1
shift 1
continue
Else If "{1}" =~ /-LenientD/ ### Lenient Discipline 2.0
set DisciplineOption 2
shift 1
continue
Else If "{1}" =~ /-Strict2D/ ### Strict Discipline 2.0.1
set DisciplineOption 3
shift 1
continue
Else If "{1}" =~ /-Lenient2D/ ### Lenient Discipline 2.0.1
set DisciplineOption 4
shift 1
continue
Else If "{1}" =~ /-Proff/ ### Proff Tools 1.0b1
set ProffOption 1
shift 1
continue
Else If "{1}" =~ /-progress/
set ProgressOption "-p"
shift 1
continue
Else If "{1}" =~ /-≈/
Echo "### {0} - ∂"{1}∂" is not an option." > Dev:StdErr
Echo "# Usage - {0} -to dirname [ -from DirName | -custom filename ]" > Dev:StdErr
Echo "# [ -install | -update | -revert ] [ -progress ]" > Dev:StdErr
Echo "# [ -SADE ] [ -Macsbug ]" > Dev:StdErr
Exit 1
End
End
If "{ToDir}" =~ /(≈:≈)®1:/ # strip the trialing colon (if any)
set ToDir "{®1}"
End
If "{ToSADE}" == "" && "{SADEOption}" != 0
If "{InstallFlag}" == 1 ### Update existing version to current
Set ToSADE `"{ShellDirectory}"GetFileName -d -m "Select SADE folder to update:" "{DestVolume}"; Set Canceled {Status}` ∑ Dev:Null
else If "{InstallFlag}" == 2 ### Revert existing version to a previous version
Set ToSADE `"{ShellDirectory}"GetFileName -d -m "Select SADE folder to revert:" "{DestVolume}"; Set Canceled {Status}` ∑ Dev:Null
End
End
If "{ToSADE}" == "" && "{SADEOption}" != 0 ### let's assume they made a mistake
set ToSADE "{DestVolume}SADE Folder"
End
If "{ToSADE}" =~ /(≈:≈)®1:/ # strip the trialing colon (if any)
set ToSADE "{®1}"
End
If Not "`Exists -d "{ToSADE}"`"
Newfolder "{ToSADE}"
End
If "{ToMacApp}" == "" && "{MacAppFlag}" != 0
If "{InstallFlag}" == 1 ### Update existing version to current
Set ToMacApp `"{ShellDirectory}"GetFileName -d -m "Select MacApp folder to update:" "{DestVolume}"; Set Canceled {Status}` ∑ Dev:Null
else If "{InstallFlag}" == 2 ### Revert existing version to a previous version
Set ToMacApp `"{ShellDirectory}"GetFileName -d -m "Select MacApp folder to revert:" "{DestVolume}"; Set Canceled {Status}` ∑ Dev:Null
End
End
If "{ToMacApp}" == "" && "{MacAppFlag}" != 0 ### let's assume they made a mistake
set ToMacApp "{DestVolume}MacApp Folder"
End
If "{ToMacApp}" =~ /(≈:≈)®1:/ # strip the trialing colon (if any)
set ToMacApp "{®1}"
End
If Not "`Exists -d "{ToMacApp}"`"
Newfolder "{ToMacApp}"
End
If "{ToDir}" == "" && "{ToSADE}" == "" && "{ToMacApp}" == ""
Echo "### {0} - Must Select Destination Directory"
Exit 1
Else If "{FromDirs}" == "" && "{SADEOption}" == "0" &&
"{MacsBugOption}" == "0" && "{411Option}" == "0" && "{ResEditOption}" == "0"
Echo "### {0} - Must Select Source Directory"
Exit 1
End
If Not "`Exists -d "{CDVolume}"`"
Alert "Volume {CDVolume} is not online!"
Exit 1
End
If {DebugFlag} == 1
echo "FromDirs: {FromDirs}" > Dev:StdOut
echo "ToDir: {ToDir}" > Dev:StdOut
echo "ToSADE: {ToSADE}" > Dev:StdOut
echo "ToMacApp: {ToMacApp}" > Dev:StdOut
echo "SADE Option: {SADEOption}" > Dev:StdOut
echo "CustomFiles: {CustomFiles}" > Dev:StdOut
echo "UpdateFlag: {UpdateFlag}" > Dev:StdOut
echo "InstallFlag: {InstallFlag}" > Dev:StdOut
echo "RevertFlag: {RevertFlag}" > Dev:StdOut
echo "RevertOption: {RevertOption}" > Dev:StdOut
echo "ProgressOption:{ProgressOption}" > Dev:StdOut
Exit 1
End
echo "### Installation begun at "`date -t`" on "`date -d`" ###" > Installer.Log
# The backup tool will generate shell commands to copy the files off
# of the distribution compact disk into the final destination folder.
If "{FromDirs}" != ""
For dir in {FromDirs}
"{ShellDirectory}"Backup -from "{dir}" -to "{ToDir}" -r -a -c {RevertFlag} {ProgressOption} > copyStuff
echo '### Copying from '"{dir}"' to '"{ToDir}"' at '`date -t`' on '`date -d`' ###' >> Installer.Log
# The DoIt script will execute the copy commands in the temporary
# copyStuff file. It will highlight each command as it is executed.
"{ShellDirectory}"DoIt copyStuff ≥ errorFile
catenate copystuff >> Installer.Log ### save the commands!
End
End
### Now handle the special cases like SADE, Macsbug, 411 and ResEdit
### One More Time...
If Not "`Exists -d "{CDVolume}"`"
Alert "Volume {CDVolume} is not online!"
Exit 1
End
### Special for MacApp - create folder, copy stuff and move the UserStartup file into the MPW folder.
If "{MacAppFlag}" != "0"
If Not "`Exists -d "{ToMacApp}"`"
NewFolder "{ToMacApp}"
End
echo '### Copying from '"{MacAppSource}{FromMacApp}"' to '"{ToMacApp}"' at '`date -t`' on '`date -d`' ###' >> Installer.Log
"{ShellDirectory}"Backup -from "{MacAppSource}{FromMacApp}" -to "{ToMacApp}" -r -a -c {RevertFlag} {ProgressOption} > copyStuff
# The DoIt script will execute the copy commands in the temporary
# copyStuff file. It will highlight each command as it is executed.
"{ShellDirectory}"DoIt copyStuff ≥ errorFile
catenate copystuff >> Installer.Log ### save the commands!
If "`Exists -d "{ToDir}"`"
If "`Exists -f "{ToMacApp}:UserStartup•MacApp"`"
Duplicate -y "{ToMacApp}:UserStartup•MacApp" "{ToDir}:UserStartup•MacApp"
End
End
End
### Install SADE 1.1 or 1.3b1
If "{SADEOption}" != "0"
echo "### Installation of SADE at "`date -t`" on "`date -d`" ###" >> Installer.Log
If "{ProgressOption}" =~ /-p/
Echo "Now Copying SADE..."
End
"SADE Install"
End
### Install Macsbug v. 6.2.1
If "{MacsbugOption}" != "0"
echo "### Installation of MacsBug at "`date -t`" on "`date -d`" ###" >> Installer.Log
If "{ProgressOption}" =~ /-p/
Echo "Now Copying MacsBug..."
End
"MacsBug Install" ≥ errorFile
End
### Install ResEdit v. 1.2, 2.1 or 2.1.1b1
If "{ResEditOption}" != "0"
echo "### Installation of Resedit at "`date -t`" on "`date -d`" ###" >> Installer.Log
If "{ProgressOption}" =~ /-p/
Echo "Now Copying ResEdit..."
End
"ResEdit Install" ≥ errorFile
End
### Install Omega SANE v. 1.0b5
If "{SANEOption}" != "0"
echo "### Installation of Omega SANE at "`date -t`" on "`date -d`" ###" >> Installer.Log
If "{ProgressOption}" =~ /-p/
Echo "Now Copying Omega SANE..."
End
"SANE Install" ≥ errorFile
End
### Install 411
If "{411Option}" != "0"
echo "### Installation of “411” at "`date -t`" on "`date -d`" ###" >> Installer.Log
If "{ProgressOption}" =~ /-p/
Echo "Now Copying 411..."
End
"411 Install" ≥ errorFile
End
### Install Big Brother
If "{BBOption}" != "0"
echo "### Installation of Big Brother at "`date -t`" on "`date -d`" ###" >> Installer.Log
If "{ProgressOption}" =~ /-p/
Echo "Now Copying Big Brother..."
End
"Big Brother Install" ≥ errorFile
End
### Install SourceBug
If "{SBOption}" != "0"
echo "### Installation of SourceBug at "`date -t`" on "`date -d`" ###" >> Installer.Log
If "{ProgressOption}" =~ /-p/
Echo "Now Copying SourceBug..."
End
"SourceBug Install" ≥ errorFile
End
### Install Discipline
If "{DisciplineOption}" != "0"
echo "### Installation of Discipline at "`date -t`" on "`date -d`" ###" >> Installer.Log
If "{ProgressOption}" =~ /-p/
If "{DisciplineOption}" == "1" || "{DisciplineOption}" == "3"
Echo "Now Copying Strict Discipline..."
Else If "{DisciplineOption}" == "2" || If "{DisciplineOption}" == "4"
Echo "Now Copying Lenient Discipline..."
End
End
"Discipline Install" ≥ errorFile
End
### Install Proff
If "{ProffOption}" != "0"
echo "### Installation of Proff tools at "`date -t`" on "`date -d`" ###" >> Installer.Log
If "{ProgressOption}" =~ /-p/
Echo "Now Copying Proff Tools..."
End
"Proff Install" ≥ errorFile
End
echo "### Installation completed at "`date -t`" on "`date -d`" ###" >> Installer.Log
# If we got some error while copying the file from the distribution
# compact disk to the destination disk, display the error message and quit.
If "`Exists -f "errorFile"`"
Open -t errorFile
Find • errorFile
Find /'#'/ errorFile ### There is an error
Set FindStatus {Status}
Close errorFile
Else
Set FindStatus 1
End
If "{FindStatus}" == "0"
Alert "`catenate errorFile`"
Close -n copyStuff ≥ dev:null
Delete "errorfile" ≥ dev:null
Quit
Else
Delete copyStuff ≥ dev:null
End
Exit 0